Skip to content

Redesign playground, prettify JSON result#28

Merged
Sander-Toonen merged 2 commits into
masterfrom
feature/redesign-playground
Jan 23, 2026
Merged

Redesign playground, prettify JSON result#28
Sander-Toonen merged 2 commits into
masterfrom
feature/redesign-playground

Conversation

@Sander-Toonen

Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings January 23, 2026 15:38
@Sander-Toonen Sander-Toonen merged commit e8eefaf into master Jan 23, 2026
8 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR redesigns the playground layout from a three-pane horizontal split with a fixed footer to a more flexible layout with an expression pane at the top and a resizable bottom area that splits horizontally between context and results. The changes also add JSON syntax highlighting to prettify the display of evaluation results.

Changes:

  • Restructured the layout from a side-by-side expression/context split with a footer to a top expression pane with a horizontally split bottom area (context left, results right)
  • Renamed the resizer from #resizer to #verticalResizer and updated its logic to resize the context/results split
  • Added JSON syntax highlighting with color-coded display for different JSON types (keys, strings, numbers, booleans, null)

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
samples/language-service-sample/styles.css Added new layout CSS for workArea, expressionPane, bottomArea, contextPane, and resultsPane; renamed resizer to verticalResizer; added JSON syntax highlighting color classes for both light and dark themes
samples/language-service-sample/index.html Restructured the DOM from a three-column layout with footer to a nested layout with expression pane at top and horizontally split context/results at bottom; moved results from footer into resultsPane
samples/language-service-sample/app.js Updated resizer logic to work with new layout structure; added syntaxHighlightJson function; modified showResult to display results with syntax highlighting using innerHTML

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

typeInfo = 'Type: number';
isJson = true;
} else if (typeof result === 'string') {
displayValue = `<span class="json-string">"${result}"</span>`;

Copilot AI Jan 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

XSS vulnerability: String results are not HTML-escaped before being inserted into the DOM via innerHTML. If an expression evaluates to a string containing HTML special characters like <script>alert('xss')</script>, it will be executed as HTML. The string should be HTML-escaped before wrapping it in the span tag, similar to how it's done in the syntaxHighlightJson function on line 425.

Copilot uses AI. Check for mistakes.
const mainContent = document.getElementById('mainContent');
const resizer = document.getElementById('verticalResizer');
const contextPane = document.getElementById('contextPane');
const resultsPane = document.getElementById('resultsPane');

Copilot AI Jan 23, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused variable resultsPane.

Suggested change
const resultsPane = document.getElementById('resultsPane');

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants